<?php
/**
 * Created by PhpStorm.
 * User: zhongyb
 * Date: 17-4-11
 * Time: 下午6:30
 */

namespace common\repositories\common;


use common\entities\common\MyscrmContractSyncDeleteDataEntity;
use common\repositories\BaseRepository;
use common\support\StringHelper;

class MyscrmContractSyncDeleteDataRepository extends BaseRepository
{
    public function add($tableName, $primaryName, $dataId)
    {
        $entity = new MyscrmContractSyncDeleteDataEntity();
        $entity->isNewRecord = true;
        $entity->id = StringHelper::uuid();
        $entity->table_name = $tableName;
        $entity->primary_name = $primaryName;
        $entity->data_id = $dataId;
        $entity->created_on = date('Y-m-d H:i:s');

        return $entity->save();
    }
}